

all : longmode.com

longmode.com : longmode64check.bin pm32stub.bin longmode.asm
        nasm -f bin longmode.asm -o longmode.com
        

pm32stub.bin : pm32stub.exe
        objcopy -O binary pm32stub.exe pm32stub.bin
        
pm32stub.exe : pm32stub.obj pm32lib.obj    
        link /ENTRY:MainEntry /NODEFAULTLIB /SUBSYSTEM:NATIVE /BASE:0x200000 /ALIGN:32 pm32stub.obj pm32lib.obj

pm32stub.obj : pm32stub.c
        cl /c pm32stub.c


pm32lib.obj : pm32lib.asm
        nasm -f win32 pm32lib.asm

longmode64check.bin : longmode64check.asm
        nasm -f bin longmode64check.asm -o longmode64check.bin

clean :
        del *.obj *.exe *.bin